package com.intelligent.system.auth.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.List;

@Data
@ApiModel(description = "用户信息")
public class UserDTO {
    @ApiModelProperty(value = "用户ID", example = "1")
    private Long userId;

    @ApiModelProperty(value = "部门ID", example = "1")
    private Long deptId;

    @NotBlank(message = "登录账号不能为空")
    @Size(min = 2, max = 20, message = "登录账号长度必须在2到20个字符之间")
    @ApiModelProperty(value = "登录账号", required = true)
    private String loginName;

    @NotBlank(message = "用户类型不能为空")
    @Size(max = 2, message = "用户类型长度不能超过2个字符")
    @ApiModelProperty(value = "用户类型（00系统用户 01普通用户）", required = true)
    private String userType;

    @Email(message = "邮箱格式不正确")
    @Size(max = 50, message = "邮箱长度不能超过50个字符")
    @ApiModelProperty("用户邮箱")
    private String email;

    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号码格式不正确")
    @ApiModelProperty("手机号码")
    private String phonenumber;

    @ApiModelProperty("用户头像")
    private String avatar;

    @NotBlank(message = "密码不能为空")
    @Size(min = 6, max = 20, message = "密码长度必须在6到20个字符之间")
    @ApiModelProperty(value = "密码", required = true)
    private String password;

    @ApiModelProperty("盐值")
    private String salt;

    @ApiModelProperty("帐号状态（0正常 1停用）")
    private Byte status;

    @Size(max = 500, message = "备注长度不能超过500个字符")
    @ApiModelProperty("备注")
    private String remark;

    @ApiModelProperty("角色ID列表")
    private List<Long> roleIds;

    private List<RoleDTO> roleList;

    @ApiModelProperty("创建者")
    private String createBy;

    @ApiModelProperty("创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty("更新者")
    private String updateBy;

    @ApiModelProperty("更新时间")
    private LocalDateTime updateTime;
} 